package com.aischool.webapp.family;

import com.aischool.routes.RouteMapping;
import com.aischool.service.AiRollCallService;
import com.aischool.utils.JsonCodeEnum;
import com.aischool.utils.JsonResult;
import com.jfinal.aop.Inject;

@RouteMapping(url = "/front/family/attendance")
public class AttendanceController extends BaseFamilyController {

	@Inject
	AiRollCallService aiRollCallService;
	
	public void index() {
		render(view_path + "/attendance.html");
	}
	
	/**
	 * 获取考勤记录
	 */
	public void getattendance() {
		// 结果类
		JsonResult jr = new JsonResult();
		
		int login_student_id = this.getAttrForInt("login_student_id");
		String curdate = get("curdate");
		
		Object obj = aiRollCallService.getRollCallForStudent(login_student_id, curdate);
		
		jr.setDicKV("listcall", obj);
		
		jr.setEnum(JsonCodeEnum.Success);
		renderJson(jr.Dic);
	}
}
